package ru.reaperoq.taskmanager.dto

data class Response<T> (
    val success: Boolean = true,
    val data: T? = null,
    val code: Int,
    val message: String? = null,
) {
    companion object {
        fun <T> success(data: T): Response<T> = Response(true, data, 200)
        fun <T> error(code: Int, message: String? = null): Response<T> =
            Response(false, null, code, message)
    }
}
